package org.gp.core.config;

import org.gp.core.interceptors.WxAuthInterceptor;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

import javax.annotation.Resource;

/**
 * Created by admin on 2017/2/15.
 * 拦截器配置类
 */
@Configuration
@ComponentScan(basePackages = "org.gp.core.web")
public class WebMvcConfigurer extends WebMvcConfigurerAdapter {
    @Resource
    private WxAuthInterceptor wxAuthInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(wxAuthInterceptor)
                .addPathPatterns("/**")
                .excludePathPatterns("/user/login", "/user/auth");
    }
}
